load("//bazel:tachyon_cc.bzl", "tachyon_cc_library", "tachyon_cc_unittest")

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "callback_forward",
    hdrs = ["callback_forward.h"],
)

tachyon_cc_library(
    name = "callback",
    hdrs = ["callback.h"],
    deps = [
        ":callback_forward",
        "@com_google_absl//absl/functional:function_ref",
    ],
)

tachyon_cc_library(
    name = "function_ref",
    hdrs = ["function_ref.h"],
    deps = [
        ":functor_traits",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/functional:function_ref",
    ],
)

tachyon_cc_library(
    name = "functor_traits",
    hdrs = ["functor_traits.h"],
    deps = [
        "//tachyon/base:type_list",
        "@com_google_absl//absl/meta:type_traits",
    ],
)

tachyon_cc_library(
    name = "identity",
    hdrs = ["identity.h"],
)

tachyon_cc_library(
    name = "invoke",
    hdrs = ["invoke.h"],
)

tachyon_cc_unittest(
    name = "functional_unittests",
    srcs = [
        "function_ref_unittest.cc",
        "identity_unittest.cc",
        "invoke_unittest.cc",
    ],
    deps = [
        ":function_ref",
        ":identity",
        ":invoke",
    ],
)
